package com.zrwl.poscloud.commons.config.message;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import java.util.concurrent.Executors;

/**
 * @author 刘思童
 * @create 2021-12-28 18:15
 **/
@Configuration
public class ScheduledConfig implements SchedulingConfigurer {

    @Override
    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
        //简单粗暴的方式直接指定
        scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(4));
    }
}
